package com.alibaba.datax.plugin.reader.elasticsearchreader;

import com.alibaba.datax.common.spi.ErrorCode;

public enum EsReaderErrorCode implements ErrorCode {
    REQUIRED_VALUE("EsReader-00", "缺少必要的值"),
    CONFIG_INVALID_EXCEPTION("EsReader-01", "参数配置错误"),
    ES_CONNECT_ERROR("EsReader-02", "连接ES实例异常"),
    ES_SEARCH_ERROR("EsReader-03", "查询ES数据异常"),
    RUNTIME_EXCEPTION("EsReader-04", "运行时异常");

    private final String code;
    private final String description;

    EsReaderErrorCode(String code, String description) {
        this.code = code;
        this.description = description;
    }

    @Override
    public String getCode() {
        return this.code;
    }

    @Override
    public String getDescription() {
        return this.description;
    }

    @Override
    public String toString() {
        return String.format("Code:[%s], Description:[%s]. ", this.code, this.description);
    }
}
